import React from 'react';
import { QuestionCircleOutlined } from '@ant-design/icons';
import { Button, message, Popconfirm, PopconfirmProps, Typography } from "antd";


const cancel: PopconfirmProps['onCancel'] = (e) => {
  message.error('已取消');
};
interface Props {
  onConfirm: () => void;
}
const Confirm: React.FC<Props> = ({onConfirm}) => (
  <Popconfirm
    id="confirm"
    title="删除这条数据"
    description="你确定要删除这条数据吗?"
    onConfirm={onConfirm}
    onCancel={cancel}
    okText="Yes"
    cancelText="No"
    icon={<QuestionCircleOutlined style={{ color: 'red' }} />}
  >
    <Typography.Link type="danger" >
      删除
    </Typography.Link>
  </Popconfirm>
);

export default Confirm;
